<template>
    <div id="app">
        <router-view/>
    </div>
</template>

<script>
export default {
    name: 'App',
    created() {
        if (sessionStorage.getItem('data')) {
            this.$store.replaceState(Object.assign({}, this.$store.state, JSON.parse(sessionStorage.getItem('data'))))
            sessionStorage.removeItem('data')
        }
        window.addEventListener('beforeunload', () => {
            sessionStorage.setItem('data', JSON.stringify(this.$store.state))
        })
    }
}
</script>
<style>
html, body {
    margin: 0;
    padding: 0;
    background-color: #E9EEF3;
}
#app {
    height: 100vh;
}
</style>
